﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System;
using WorldMapNew;

public class MapTrafficCar : MonoBehaviour
{
    float _curAngle = -1;
    // 设置当前线段 起点 终点 速度 
    public void SetCurLine(Vector3 startPos, Vector3 endPos, float speed)
    { 
        // 设置初始角度
        if(_curAngle < 0) // 角度只会是[0,360)
        {
            _curAngle = Vector3.Angle(startPos, endPos) * Mathf.Rad2Deg;
            transform.localEulerAngles = new Vector3(0, _curAngle, 0);
        }
        // 计算这段路线所需时间 
        float dis = Vector3.Distance(startPos, endPos);
        float time = Mathf.Floor(dis / speed);

    }

    // 
    public bool Move()
    {
        bool bNext = false;
        return bNext;
    }
}
